import { Component ,EventEmitter,ElementRef ,Inject ,ReflectiveInjector} from '@angular/core';
import { modelComponent } from '../model/model.component';
import { Observable } from 'rxjs/Rx';

import { service } from "../service/service";



@Component({
  selector: 'app-main',
  templateUrl: './mian.component.html',
  styleUrls: ['./mian.component.css'],
  outputs:['putOutFn'],
  inputs:['name','age','isenabled:enabled']//isenabled:[input value] 
})


export class MainComponent {
	model : modelComponent;
	searchValue :string;
	putOutFn:EventEmitter<any>;
private myService:service;
	name:string;
	age:number;
	isenabled:boolean;
 	constructor(
 		private ele : ElementRef,
 		@Inject('API_URL') private Url: string,
 		){

 		// console.log(this.Url);
 		// console.log(this.ApiServiceAlias);
 		// this.model = new modelComponent('this is the title');
 		// this.putOutFn = new EventEmitter();

 		// Observable.fromEvent(this.ele.nativeElement,'click').map(e => e).subscribe(
 		// e => { console.log('e',e) },
 		// err => {  console.log('err',err) },
 		// () => {}
 		// );


 		// let injector : any = ReflectiveInjector.resolveAndCreate([service]);
 		// this.myService = injector.get(service);
 		// console.log(this.myService === injector.get(service));
 		
 	}
 	testoutPutFn(){
 		this.putOutFn.emit({name:'leo test'});
 	}

 	testReduxFn(){

 	}

}
